﻿
Imports System.IO
Imports std

Public Class xhtmlControl_1_1
    Inherits xhtmlControl_1_1_shared

    Public Sub New(ByRef buff As MemoryStream, ByRef tag As String)
        MyBase.New(buff, tag)
    End Sub

    Public Overridable Property style() As String
        Get
            Return attribute("style")
        End Get
        Set(ByVal value As String)
            attribute("style") = value
        End Set
    End Property

    Public Overridable Property cite() As uri
        Get
            Return attribute("cite")
        End Get
        Set(ByVal value As uri)
            attribute("cite") = value
        End Set
    End Property

    Public Overridable Property accesskey() As String
        Get
            Return attribute("accesskey")
        End Get
        Set(ByVal value As String)
            attribute("accesskey") = value
        End Set
    End Property

    Public Overridable Property charset() As String
        Get
            Return attribute("charset")
        End Get
        Set(ByVal value As String)
            attribute("charset") = value
        End Set
    End Property

    Public Overridable Property href() As uri
        Get
            Return attribute("href")
        End Get
        Set(ByVal value As uri)
            attribute("href") = value
        End Set
    End Property

    Public Overridable Property hreflang() As String
        Get
            Return attribute("hreflang")
        End Get
        Set(ByVal value As String)
            attribute("hreflang") = value
        End Set
    End Property

    Public Overridable Property rel() As String
        Get
            Return attribute("rel")
        End Get
        Set(ByVal value As String)
            attribute("rel") = value
        End Set
    End Property

    Public Overridable Property rev() As String
        Get
            Return attribute("rev")
        End Get
        Set(ByVal value As String)
            attribute("rev") = value
        End Set
    End Property

    Public Overridable Property tabindex() As String
        Get
            Return attribute("tabindex")
        End Get
        Set(ByVal value As String)
            attribute("tabindex") = value
        End Set
    End Property

    Public Overridable Property type() As String
        Get
            Return attribute("type")
        End Get
        Set(ByVal value As String)
            attribute("type") = value
        End Set
    End Property

    Public Overridable Property archive() As String
        Get
            Return attribute("archive")
        End Get
        Set(ByVal value As String)
            attribute("archive") = value
        End Set
    End Property

    Public Overridable Property classid() As String
        Get
            Return attribute("classid")
        End Get
        Set(ByVal value As String)
            attribute("classid") = value
        End Set
    End Property

    Public Overridable Property codebase() As String
        Get
            Return attribute("codebase")
        End Get
        Set(ByVal value As String)
            attribute("codebase") = value
        End Set
    End Property

    Public Overridable Property codetype() As String
        Get
            Return attribute("codetype")
        End Get
        Set(ByVal value As String)
            attribute("codetype") = value
        End Set
    End Property

    Public Overridable Property data() As String
        Get
            Return attribute("data")
        End Get
        Set(ByVal value As String)
            attribute("data") = value
        End Set
    End Property

    Public Overridable Property [declare]() As String
        Get
            Return attribute("declare")
        End Get
        Set(ByVal value As String)
            attribute("declare") = value
        End Set
    End Property

    Public Overridable Property height() As String
        Get
            Return attribute("height")
        End Get
        Set(ByVal value As String)
            attribute("height") = value
        End Set
    End Property

    Public Overridable Property name() As String
        Get
            Return attribute("name")
        End Get
        Set(ByVal value As String)
            attribute("name") = value
        End Set
    End Property

    Public Overridable Property standby() As String
        Get
            Return attribute("standby")
        End Get
        Set(ByVal value As String)
            attribute("standby") = value
        End Set
    End Property

    Public Overridable Property width() As String
        Get
            Return attribute("width")
        End Get
        Set(ByVal value As String)
            attribute("width") = value
        End Set
    End Property

    Public Overridable Property value() As String
        Get
            Return attribute("value")
        End Get
        Set(ByVal value As String)
            attribute("value") = value
        End Set
    End Property

    Public Enum valuetype_enum
        ref
        [object]
        data
    End Enum

    Public Overridable Property valuetype() As valuetype_enum
        Get
            If strsame(attribute("valuetype"), "ref", False) Then
                Return valuetype_enum.ref
            ElseIf strsame(attribute("valuetype"), "object", False) Then
                Return valuetype_enum.object
            Else
                Return valuetype_enum.data
            End If
        End Get
        Set(ByVal value As valuetype_enum)
            If value = valuetype_enum.ref Then
                attribute("valuetype") = "ref"
            ElseIf value = valuetype_enum.object Then
                attribute("valuetype") = "object"
            Else
                attribute("valuetype") = "data"
            End If
        End Set
    End Property

    Public Overridable Property datetime() As String
        Get
            Return attribute("datetime")
        End Get
        Set(ByVal value As String)
            attribute("datetime") = value
        End Set
    End Property

    Public Overridable Property accept() As String
        Get
            Return attribute("accept")
        End Get
        Set(ByVal value As String)
            attribute("accept") = value
        End Set
    End Property

    Public Overridable Property accept_charset() As charsets
        Get
            Return attribute("accept-charset")
        End Get
        Set(ByVal value As charsets)
            attribute("accept-charset") = value
        End Set
    End Property

    Public Overridable Property action() As uri
        Get
            Return attribute("action")
        End Get
        Set(ByVal value As uri)
            attribute("action") = value
        End Set
    End Property

    Public Enum method_enum
        post
        [get]
    End Enum

    Public Overridable Property method() As method_enum
        Get
            If strsame(attribute("method"), "post", False) Then
                Return method_enum.post
            Else
                Return method_enum.get
            End If
        End Get
        Set(ByVal value As method_enum)
            If value = method_enum.post Then
                attribute("method") = "post"
            Else
                attribute("method") = "get"
            End If
        End Set
    End Property

    Public Overridable Property enctype() As String
        Get
            Return attribute("enctype")
        End Get
        Set(ByVal value As String)
            attribute("enctype") = value
        End Set
    End Property

    Public Overridable Property alt() As String
        Get
            Return attribute("alt")
        End Get
        Set(ByVal value As String)
            attribute("alt") = value
        End Set
    End Property

    Public Overridable Property checked() As Boolean
        Get
            Return strsame(attribute("checked"), "checked", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("checked") = "checked"
            Else
                attributes.erase("checked")
            End If
        End Set
    End Property

    Public Overridable Property disabled() As Boolean
        Get
            Return strsame(attribute("disabled"), "disabled", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("disabled") = "disabled"
            Else
                attributes.erase("disabled")
            End If
        End Set
    End Property

    Public Overridable Property maxlength() As Int64
        Get
            Return attribute("maxlength")
        End Get
        Set(ByVal value As Int64)
            attribute("maxlength") = value
        End Set
    End Property

    Public Overridable Property [readonly]() As Boolean
        Get
            Return strsame(attribute("readonly"), "readonly", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("readonly") = "readonly"
            Else
                attributes.erase("readonly")
            End If
        End Set
    End Property

    Public Overridable Property size() As Int64
        Get
            Return attribute("size")
        End Get
        Set(ByVal value As Int64)
            attribute("size") = value
        End Set
    End Property

    Public Overridable Property src() As uri
        Get
            Return attribute("src")
        End Get
        Set(ByVal value As uri)
            attribute("src") = value
        End Set
    End Property

    Public Overridable Property multiple() As Boolean
        Get
            Return strsame(attribute("multiple"), "multiple", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("multiple") = "multiple"
            Else
                attributes.erase("multiple")
            End If
        End Set
    End Property

    Public Overridable Property selected() As Boolean
        Get
            Return strsame(attribute("selected"), "selected", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("selected") = "selected"
            Else
                attributes.erase("selected")
            End If
        End Set
    End Property

    Public Overridable Property label() As String
        Get
            Return attribute("label")
        End Get
        Set(ByVal value As String)
            attribute("label") = value
        End Set
    End Property

    Public Overridable Property cols() As Int64
        Get
            Return attribute("cols")
        End Get
        Set(ByVal value As Int64)
            attribute("cols") = value
        End Set
    End Property

    Public Overridable Property rows() As Int64
        Get
            Return attribute("rows")
        End Get
        Set(ByVal value As Int64)
            attribute("rows") = value
        End Set
    End Property

    Public Overridable Property [for]() As IDREF
        Get
            Return attribute("for")
        End Get
        Set(ByVal value As IDREF)
            attribute("for") = value
        End Set
    End Property

    Public Overridable Property border() As Int64
        Get
            Return attribute("border")
        End Get
        Set(ByVal value As Int64)
            attribute("border") = value
        End Set
    End Property

    Public Overridable Property cellpadding() As Int64
        Get
            Return attribute("cellpadding")
        End Get
        Set(ByVal value As Int64)
            attribute("cellpadding") = value
        End Set
    End Property

    Public Overridable Property cellspacing() As Int64
        Get
            Return attribute("cellspacing")
        End Get
        Set(ByVal value As Int64)
            attribute("cellspacing") = value
        End Set
    End Property

    Public Enum frame_enum
        void
        above
        below
        hsides
        lhs
        rhs
        vsides
        box
        border
    End Enum

    Public Overridable Property frame() As frame_enum
        Get
            If strsame(attribute("frame"), "void", False) Then
                Return frame_enum.void
            ElseIf strsame(attribute("frame"), "above", False) Then
                Return frame_enum.above
            ElseIf strsame(attribute("frame"), "below", False) Then
                Return frame_enum.below
            ElseIf strsame(attribute("frame"), "hsides", False) Then
                Return frame_enum.hsides
            ElseIf strsame(attribute("frame"), "lhs", False) Then
                Return frame_enum.lhs
            ElseIf strsame(attribute("frame"), "rhs", False) Then
                Return frame_enum.rhs
            ElseIf strsame(attribute("frame"), "vsides", False) Then
                Return frame_enum.vsides
            ElseIf strsame(attribute("frame"), "box", False) Then
                Return frame_enum.box
            ElseIf strsame(attribute("frame"), "border", False) Then
                Return frame_enum.border
            Else
                'no default value in w3
                'http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_tablemodule
                Return frame_enum.void
            End If
        End Get
        Set(ByVal value As frame_enum)
            Select Case value
                Case frame_enum.void
                    attribute("frame") = "void"
                Case frame_enum.above
                    attribute("frame") = "above"
                Case frame_enum.below
                    attribute("frame") = "below"
                Case frame_enum.hsides
                    attribute("frame") = "hsides"
                Case frame_enum.lhs
                    attribute("frame") = "lhs"
                Case frame_enum.rhs
                    attribute("frame") = "rhs"
                Case frame_enum.vsides
                    attribute("frame") = "vsides"
                Case frame_enum.box
                    attribute("frame") = "box"
                Case frame_enum.border
                    attribute("frame") = "border"
                Case Else
                    attribute("frame") = "void"
            End Select
        End Set
    End Property

    Public Enum rules_enum
        none
        groups
        rows
        cols
        all
    End Enum

    Public Overridable Property rules() As rules_enum
        Get
            If strsame(attribute("rules"), "none", False) Then
                Return rules_enum.none
            ElseIf strsame(attribute("rules"), "groups", False) Then
                Return rules_enum.groups
            ElseIf strsame(attribute("rules"), "rows", False) Then
                Return rules_enum.rows
            ElseIf strsame(attribute("rules"), "cols", False) Then
                Return rules_enum.cols
            ElseIf strsame(attribute("rules"), "all", False) Then
                Return rules_enum.all
            Else
                'also no default value, same as frame
                Return rules_enum.none
            End If
        End Get
        Set(ByVal value As rules_enum)
            Select Case value
                Case rules_enum.none
                    attribute("rules") = "none"
                Case rules_enum.groups
                    attribute("rules") = "groups"
                Case rules_enum.rows
                    attribute("rules") = "rows"
                Case rules_enum.cols
                    attribute("rules") = "cols"
                Case rules_enum.all
                    attribute("rules") = "all"
                Case Else
                    attribute("rules") = "none"
            End Select
        End Set
    End Property

    Public Overridable Property summary() As String
        Get
            Return attribute("summary")
        End Get
        Set(ByVal value As String)
            attribute("summary") = value
        End Set
    End Property

    Public Overridable Property abbr() As String
        Get
            Return attribute("abbr")
        End Get
        Set(ByVal value As String)
            attribute("abbr") = value
        End Set
    End Property

    Public Enum align_enum
        left
        center
        right
        justify
        [char]
    End Enum

    Public Overridable Property align() As align_enum
        Get
            If strsame(attribute("align"), "left", False) Then
                Return align_enum.left
            ElseIf strsame(attribute("align"), "center", False) Then
                Return align_enum.center
            ElseIf strsame(attribute("align"), "right", False) Then
                Return align_enum.right
            ElseIf strsame(attribute("align"), "justify", False) Then
                Return align_enum.justify
            ElseIf strsame(attribute("align"), "char", False) Then
                Return align_enum.char
            Else
                'no default value in w3
                'http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_tablemodule
                Return align_enum.left
            End If
        End Get
        Set(ByVal value As align_enum)
            Select Case value
                Case align_enum.left
                    attribute("align") = "left"
                Case align_enum.center
                    attribute("align") = "center"
                Case align_enum.right
                    attribute("align") = "right"
                Case align_enum.justify
                    attribute("align") = "justify"
                Case align_enum.char
                    attribute("align") = "char"
                Case Else
                    attribute("align") = "left"
            End Select
        End Set
    End Property

    Public Overridable Property axis() As String
        Get
            Return attribute("axis")
        End Get
        Set(ByVal value As String)
            attribute("axis") = value
        End Set
    End Property

    Public Overridable Property [char]() As character
        Get
            Return attribute("char")
        End Get
        Set(ByVal value As character)
            attribute("char") = value
        End Set
    End Property

    Public Overridable Property charoff() As Int64
        Get
            Return attribute("charoff")
        End Get
        Set(ByVal value As Int64)
            attribute("charoff") = value
        End Set
    End Property

    Public Overridable Property colspan() As Int64
        Get
            Return attribute("colspan")
        End Get
        Set(ByVal value As Int64)
            attribute("colspan") = value
        End Set
    End Property

    Public Overridable Property headers() As IDREFS
        Get
            Return attribute("headers")
        End Get
        Set(ByVal value As IDREFS)
            attribute("headers") = value
        End Set
    End Property

    Public Overridable Property rowspan() As Int64
        Get
            Return attribute("rowspan")
        End Get
        Set(ByVal value As Int64)
            attribute("rowspan") = value
        End Set
    End Property

    Public Enum scope_enum
        row
        col
        rowgroup
        colgroup
    End Enum

    Public Overridable Property scope() As scope_enum
        Get
            If strsame(attribute("scope"), "row", False) Then
                Return scope_enum.row
            ElseIf strsame(attribute("scope"), "col", False) Then
                Return scope_enum.col
            ElseIf strsame(attribute("scope"), "rowgroup", False) Then
                Return scope_enum.rowgroup
            ElseIf strsame(attribute("scope"), "colgroup", False) Then
                Return scope_enum.colgroup
            Else
                'no default value, same as align
                Return scope_enum.row
            End If
        End Get
        Set(ByVal value As scope_enum)
            Select Case value
                Case scope_enum.row
                    attribute("scope") = "row"
                Case scope_enum.col
                    attribute("scope") = "col"
                Case scope_enum.rowgroup
                    attribute("scope") = "rowgroup"
                Case scope_enum.colgroup
                    attribute("scope") = "colgroup"
                Case Else
                    attribute("scope") = "row"
            End Select
        End Set
    End Property

    Public Enum valign_enum
        top
        middle
        bottom
        baseline
    End Enum

    Public Overridable Property valign() As valign_enum
        Get
            If strsame(attribute("valign"), "top", False) Then
                Return valign_enum.top
            ElseIf strsame(attribute("valign"), "middle", False) Then
                Return valign_enum.middle
            ElseIf strsame(attribute("valign"), "bottom", False) Then
                Return valign_enum.bottom
            ElseIf strsame(attribute("valign"), "baseline", False) Then
                Return valign_enum.baseline
            Else
                'no default value, same as align
                Return valign_enum.baseline
            End If
        End Get
        Set(ByVal value As valign_enum)
            Select Case value
                Case valign_enum.top
                    attribute("valign") = "top"
                Case valign_enum.middle
                    attribute("valign") = "middle"
                Case valign_enum.bottom
                    attribute("valign") = "bottom"
                Case valign_enum.baseline
                    attribute("valign") = "baseline"
                Case Else
                    attribute("valign") = "baseline"
            End Select
        End Set
    End Property

    Public Overridable Property span() As Int64
        Get
            Return attribute("span")
        End Get
        Set(ByVal value As Int64)
            attribute("span") = value
        End Set
    End Property

    Public Overridable Property longdesc() As uri
        Get
            Return attribute("longdesc")
        End Get
        Set(ByVal value As uri)
            attribute("longdesc") = value
        End Set
    End Property

    Public Overridable Property coords() As String
        Get
            Return attribute("coords")
        End Get
        Set(ByVal value As String)
            attribute("coords") = value
        End Set
    End Property

    Public Enum shape_enum
        rect
        circle
        poly
        [default]
    End Enum

    Public Overridable Property shape() As shape_enum
        Get
            If strsame(attribute("shape"), "rect", False) Then
                Return shape_enum.rect
            ElseIf strsame(attribute("shape"), "circle", False) Then
                Return shape_enum.circle
            ElseIf strsame(attribute("shape"), "poly", False) Then
                Return shape_enum.poly
            Else
                Return shape_enum.default
            End If
        End Get
        Set(ByVal value As shape_enum)
            Select Case value
                Case shape_enum.rect
                    attribute("shape") = "rect"
                Case shape_enum.circle
                    attribute("shape") = "circle"
                Case shape_enum.poly
                    attribute("shape") = "poly"
                Case Else
                    attribute("shape") = "default"
            End Select
        End Set
    End Property

    Public Overridable Property usemap() As IDREF
        Get
            Return attribute("usemap")
        End Get
        Set(ByVal value As IDREF)
            attribute("usemap") = value
        End Set
    End Property

    Public Overridable Property nohref() As Boolean
        Get
            Return strsame(attribute("nohref"), "nohref", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("nohref") = "nohref"
            Else
                attributes.erase("nohref")
            End If
        End Set
    End Property

    Public Overridable Property ismap() As Boolean
        Get
            Return strsame(attribute("ismap"), "ismap", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("ismap") = "ismap"
            Else
                attributes.erase("ismap")
            End If
        End Set
    End Property

    Public Overridable Property onblur() As String
        Get
            Return attribute("onblur")
        End Get
        Set(ByVal value As String)
            attribute("onblur") = value
        End Set
    End Property

    Public Overridable Property onfocus() As String
        Get
            Return attribute("onfocus")
        End Get
        Set(ByVal value As String)
            attribute("onfocus") = value
        End Set
    End Property

    Public Overridable Property onload() As String
        Get
            Return attribute("onload")
        End Get
        Set(ByVal value As String)
            attribute("onload") = value
        End Set
    End Property

    Public Overridable Property onunload() As String
        Get
            Return attribute("onunload")
        End Get
        Set(ByVal value As String)
            attribute("onunload") = value
        End Set
    End Property

    Public Overridable Property onreset() As String
        Get
            Return attribute("onreset")
        End Get
        Set(ByVal value As String)
            attribute("onreset") = value
        End Set
    End Property

    Public Overridable Property onsubmit() As String
        Get
            Return attribute("onsubmit")
        End Get
        Set(ByVal value As String)
            attribute("onsubmit") = value
        End Set
    End Property

    Public Overridable Property onchange() As String
        Get
            Return attribute("onchange")
        End Get
        Set(ByVal value As String)
            attribute("onchange") = value
        End Set
    End Property

    Public Overridable Property onpropertychange() As String
        Get
            Return attribute("onpropertychange")
        End Get
        Set(ByVal value As String)
            attribute("onpropertychange") = value
        End Set
    End Property

    Public Overridable Property onselect() As String
        Get
            Return attribute("onselect")
        End Get
        Set(ByVal value As String)
            attribute("onselect") = value
        End Set
    End Property

    Public Overridable Property content() As String
        Get
            Return attribute("content")
        End Get
        Set(ByVal value As String)
            attribute("content") = value
        End Set
    End Property

    Public Overridable Property http_equiv() As nmtoken
        Get
            Return attribute("http-equiv")
        End Get
        Set(ByVal value As nmtoken)
            attribute("http-equiv") = value
        End Set
    End Property

    Public Overridable Property scheme() As String
        Get
            Return attribute("scheme")
        End Get
        Set(ByVal value As String)
            attribute("scheme") = value
        End Set
    End Property

    Public Overridable Property defer() As Boolean
        Get
            Return strsame(attribute("defer"), "defer", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("defer") = "defer"
            Else
                attributes.erase("defer")
            End If
        End Set
    End Property

    Public Overridable Property media() As mediadesc
        Get
            Return attribute("media")
        End Get
        Set(ByVal value As mediadesc)
            attribute("media") = value
        End Set
    End Property

    Public Overridable Property frameborder() As Byte
        Get
            Return attribute("frameborder")
        End Get
        Set(ByVal value As Byte)
            If value = 0 Then
                attribute("frameborder") = 0
            Else
                attribute("frameborder") = 1
            End If
        End Set
    End Property

    Public Overridable Property marginheight() As Int64
        Get
            Return attribute("marginheight")
        End Get
        Set(ByVal value As Int64)
            attribute("marginheight") = value
        End Set
    End Property

    Public Overridable Property marginwidth() As Int64
        Get
            Return attribute("marginwidth")
        End Get
        Set(ByVal value As Int64)
            attribute("marginwidth") = value
        End Set
    End Property

    Public Overridable Property noresize() As Boolean
        Get
            Return strsame(attribute("noresize"), "noresize", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("noresize") = "noresize"
            Else
                attributes.erase("noresize")
            End If
        End Set
    End Property

    Public Enum scrolling_enum
        yes
        no
        auto
    End Enum

    Public Overridable Property scrolling() As scrolling_enum
        Get
            If strsame(attribute("scrolling"), "yes", False) Then
                Return scrolling_enum.yes
            ElseIf strsame(attribute("scrolling"), "no", False) Then
                Return scrolling_enum.no
            Else
                Return scrolling_enum.auto
            End If
        End Get
        Set(ByVal value As scrolling_enum)
            Select Case value
                Case scrolling_enum.yes
                    attribute("scrolling") = "yes"
                Case scrolling_enum.no
                    attribute("scrolling") = "no"
                Case Else
                    attribute("scrolling") = "auto"
            End Select
        End Set
    End Property

    Public Overridable Property target() As String
        Get
            Return attribute("target")
        End Get
        Set(ByVal value As String)
            attribute("target") = value
        End Set
    End Property

    Public Overridable Property code() As String
        Get
            Return attribute("code")
        End Get
        Set(ByVal value As String)
            attribute("code") = value
        End Set
    End Property

    Public Overridable Property [object]() As String
        Get
            Return attribute("object")
        End Get
        Set(ByVal value As String)
            attribute("object") = value
        End Set
    End Property

    Public Overridable Property color() As color
        Get
            Return attribute("color")
        End Get
        Set(ByVal value As color)
            attribute("color") = color
        End Set
    End Property

    Public Overridable Property face() As String
        Get
            Return attribute("face")
        End Get
        Set(ByVal value As String)
            attribute("face") = value
        End Set
    End Property

    Public Overridable Property compact() As Boolean
        Get
            Return strsame(attribute("compact"), "compact", False)
        End Get
        Set(ByVal value As Boolean)
            If value Then
                attribute("compact") = "compact"
            Else
                attributes.erase("compact")
            End If
        End Set
    End Property

    Public Overridable Property prompt() As String
        Get
            Return attribute("prompt")
        End Get
        Set(ByVal value As String)
            attribute("prompt") = value
        End Set
    End Property
End Class
